package com.atguigu.principle.demeter.improve;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: design-patterns
 * @author: yangshen
 * @description: 学院员工的管理类
 * @create: 2022-01-12 22:45
 **/
public class CollegeManage {
    /**
     * 获取所有学院的员工
     * @return 学院员工列表
     */
    public List<CollegeEmployee> getAllEmployee(){
        List<CollegeEmployee> list = new ArrayList<CollegeEmployee>();
        for (int i = 1; i <= 10; i++) {
            CollegeEmployee collegeEmployee = new CollegeEmployee();
            collegeEmployee.setId("学院员工id = " + i);
            list.add(collegeEmployee);
        }
        return list;
    }

    /**
     * 输出学院的员工
     */
    public void printAllEmployee(){
        //获取学院的员工
        List<CollegeEmployee> collegeEmployeeList = this.getAllEmployee();
        System.out.println("-------------------学院的员工-------------------------------");
        for (CollegeEmployee collegeEmployee : collegeEmployeeList) {
            System.out.println(collegeEmployee.getId());
        }
    }
}
